#!/usr/bin/python

import wx

class FindReplaceDialog(wx.Dialog):
    def __init__(me,parent,id=wx.ID_ANY, use_metal=True, **kw):
	wx.Dialog.__init__(me,parent,id,'Find & Replace',**kw)

        # This extra style can be set after the UI object has been created.
	if 'wxMac' in wx.PlatformInfo and use_metal:
		me.SetExtraStyle(wx.DIALOG_EX_METAL)

	top_box=wx.BoxSizer(wx.HORIZONTAL)
	
	if 1:
		find_box=wx.BoxSizer(wx.VERTICAL)
		top_box.Add(find_box,1,wx.RIGHT,5)
		
		if 1:
			find_box_row1=wx.BoxSizer(wx.HORIZONTAL)
			find_box.Add(find_box_row1,1,wx.EXPAND)
			
			c=wx.CheckBox(me,wx.ID_ANY,'Match Case')
			find_box_row1.Add(c,0)
				
			find_text=wx.TextCtrl(me,wx.ID_ANY,"foo",size=(200,-1))
			find_box_row1.Add(find_text,1,wx.EXPAND)
		
		if 1:
			find_box_row2=wx.BoxSizer(wx.HORIZONTAL)
			find_box.Add(find_box_row2,1,wx.EXPAND)

			c=wx.CheckBox(me,wx.ID_ANY,'Whole Word')
			find_box_row2.Add(c,1)
			
			c=wx.CheckBox(me,wx.ID_ANY,'Reg Exp')
			find_box_row2.Add(c,1)
			
			b=wx.Button(me,wx.ID_FIND,"Find")
			b.SetDefault()
			#me.Bind(wx.EVT_BUTTON, me.OnFindClicked,b)
			find_box_row2.Add(b,1)
			
			b=wx.Button(me,wx.ID_CLOSE,"Close")
			#me.Bind(wx.EVT_BUTTON, me.OnCloseClicked,b)
			find_box_row2.Add(b,1)
	if 1:
		replace_box=wx.BoxSizer(wx.VERTICAL)
		top_box.Add(replace_box,1)
		
		if 1:
			replace_text=wx.TextCtrl(me,wx.ID_ANY,"foo",size=(200,-1))
			replace_box.Add(replace_text,1,wx.EXPAND)
			
		if 1:
			replace_row2=wx.BoxSizer(wx.HORIZONTAL)
			replace_box.Add(replace_row2,1,wx.ALIGN_RIGHT)
			
			b=wx.Button(me,wx.ID_ANY,"Replace")
			#me.Bind(wx.EVT_BUTTON, me.OnFindClicked,b)
			replace_row2.Add(b,1)
			
			b=wx.Button(me,wx.ID_ANY,"Replace All")
			#me.Bind(wx.EVT_BUTTON, me.OnCloseClicked,b)
			replace_row2.Add(b,1)
		
	
	me.SetSizer(top_box)
	top_box.Fit(me)		

app = wx.PySimpleApp()
d = FindReplaceDialog(None)
d.Show(True)
d.Centre()
app.MainLoop()